package com.xiaoq.social.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.xiaoq.social.entity.FollowEntity;
import com.xiaoq.social.repository.IFollowRepository;
import com.xiaoq.social.service.IFollowService;
import com.xiaoq.vo.PagingVo;

@Component
public class FollowServiceImpl implements IFollowService {
	
	@Autowired
	private IFollowRepository followRep;

	@Override
	public boolean isFollow(String tgtId, String userId) {
		
		return followRep.isFollow(tgtId, userId);
	}

	@Override
	public boolean addFollow(FollowEntity follow) {
		
		return followRep.addFollow(follow);
	}

	@Override
	public boolean delFollow(String userId, String tgtId) {
		
		return followRep.delFollow(userId, tgtId);
	}

	@Override
	public Long findFollowNumsByUser(String userId) {
		
		return followRep.findFollowNumsByUser(userId);
	}

	@Override
	public Long findFollowNumsByTgt(String tgtId) {
		return followRep.findFollowNumsByTgt(tgtId);
	}

	@Override
	public List<FollowEntity> findFollowListByUser(String userId, PagingVo pvo) {

		return followRep.findFollowListByUser(userId, pvo);
	}

}
